剑指offer56题，删除重复节点
/*
 public class ListNode {
    int val;
    ListNode next = null;

    ListNode(int val) {
        this.val = val;
    }
}
*/
public class Solution {
    public ListNode deleteDuplication(ListNode pHead){
		if(pHead==null||pHead.next==null)return pHead;
		ListNode newHead=new ListHead(-1);
		newHead.next=head;
		ListNode prev=newHead;
		ListNode cur=pHead;
		while(pHead!=null){
			if(pHead.next!=null&&pHead.val==pHead.next.val){//有重复的情况，删除
				while(pHead.next!=null&&pHead.val==pHead.next.val){
					cur=cur.next;
				}
				cur=cur.next;//多走一步是因为cur指向的还是一个重复元素
				prev.next=cur;//prev用来链接后面的节点
			}else{
			prev=cur;
			cur=cur.next;
			}
		}
	return newHead.next;
	}
}